package com.daocao.jy.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.daocao.jy.R;
import com.daocao.jy.base.BaseActivity;
import com.daocao.jy.util.Dialog;
import com.daocao.jy.util.Util;
import com.daocao.jy.view.ChangeBankCardDialog;
import com.daocao.jy.view.V19FrameLayout;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * Created by xsooy-pc on 17-12-8.
 */

public class WalletWithdrawActivity extends BaseActivity {
    @BindView(R.id.btn_back)
    ImageView btnBack;
    @BindView(R.id.txt_title)
    TextView txtTitle;
    @BindView(R.id.txt_right)
    TextView txtRight;
    @BindView(R.id.layout_title)
    V19FrameLayout layoutTitle;
    @BindView(R.id.btn_change_bankcard)
    LinearLayout btnChangeBankcard;
    @BindView(R.id.view_has_bankcard)
    View viewHasBankcard;
    @BindView(R.id.layout_has_bankcard)
    LinearLayout layoutHasBankcard;
    @BindView(R.id.btn_submit)
    TextView btnSubmit;

    private Unbinder unbiner;
    private ChangeBankCardDialog dialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_wallet_withdraw);
        initBar();
        unbiner = ButterKnife.bind(this);
        init();
    }

    private void init() {
        txtTitle.setText("提现");
        dialog = new ChangeBankCardDialog(this);
        dialog.setDialogClickListener(new ChangeBankCardDialog.DialogDefaultClickListener() {
            @Override
            public void confirm() {

            }

            @Override
            public void cancel() {

            }
        });
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        unbiner.unbind();
        unbiner = null;
    }

    @OnClick({R.id.btn_back, R.id.btn_change_bankcard, R.id.btn_submit})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_back:
                finish();
                break;
            case R.id.btn_change_bankcard:
                dialog.show();
                break;
            case R.id.btn_submit:
                Dialog.showDefaultDialog(this, "", "您的提现申请已经提交，平台审核通过后，将直接提现到你选择的相关账户。", "", "好", false, new Dialog.DialogDefaultClickListener() {
                    @Override
                    public void confirm() {
                        Util.startActivity(WalletWithdrawActivity.this, BankCardFirstActivity.class);
                    }

                    @Override
                    public void cancel() {

                    }
                });
                break;
        }
    }
}
